package com.atguigu.r2dbc.repository;

import com.atguigu.r2dbc.entity.Book;
import org.springframework.data.r2dbc.repository.R2dbcRepository;
import org.springframework.stereotype.Repository;

/**
 * @author Jungle
 * @create 2024-01-16 11:37
 * 写 AuthorRepositories 接口
 */
@Repository
public interface BookRepository extends R2dbcRepository<Book,Long> {

    //
    // // 1对一 查询出图书及作者
    // @Query("SELECT b.*,a.`name`,a.id_number FROM `t_book` b LEFT JOIN t_author a ON b.author_id=a.id where b.title=? and b.author_id=?")
    // Mono<Book> hahaBook(@Param("title") String title,@Param("authorId") Long authorId);
    //
    //
    // @Query("SELECT b.*,a.`name`,a.id_number FROM `t_book` b LEFT JOIN t_author a ON b.author_id=a.id where b.id=:bookId")
    // Mono<Book> hahaBook(@Param("bookId") Long bookId);




}
